db=$1
type=$2
sed -i -r "1s/spider.*;/$db;/g" switch.sql
if [ "$type" == "online" ]; then
    echo 'online'
    mysql -h101.200.81.152 -uzhugef_online -p'emd3ZW56*$FuYmFanVuZmVuZw%db' -P3307 --default-character-set=utf8 < switch.sql
else
    echo 'offline'
    mysql -h182.92.96.120 -uoffline_lijuan -p'996%16BDC&EB0088*2716E42A!15ACDD' --default-character-set=utf8 < switch.sql
fi
